<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .grid-container {
      /* 网格布局 */
      display: inline-grid;
      grid-template-columns: [a1] 100px [a2] 100px [a3] 100px [a4];
      grid-template-rows: [c1] 100px [c2] 100px [c3] 100px [c4];
      margin: 100px;
    }
    .grid-item {
      padding: 10px;
      font-size: 30px;
      color: red;
    }
    .item1 {
      grid-row-start: 1; /* 起始行网格线 */
      grid-row-end: 3; /* 结束行网格线 */
      grid-column-start: 1; /* 起始列网格线 */
      grid-column-end: 3; /* 结束列网格线 */
      background-color: pink;
    }
    .item2 {
      background-color: rgb(135, 206, 235, 0.5);
      grid-row-start: 1;
      grid-row-end: 3;
      grid-column-start: 2;
      grid-column-end: 4;
      /* 调整重叠的顺序 */
      z-index: 3;
    }
    .item3 {
      background-color: khaki;
      grid-row-start: 2;
      grid-row-end: 4;
      grid-column-start: 2;
      z-index: 2;
    }
  </style>
  <body>
    <!-- 
        TIP

        如果项目发生重叠，通过 z-index 属性指定项目的重叠顺序。
        z-index 的值越大，越在上面。
    -->
    <div class="grid-container">
      <div class="grid-item item1">1</div>
      <div class="grid-item item2">2</div>
      <div class="grid-item item3">3</div>
      <div class="grid-item">4</div>
    </div>
  </body>
</html>